package com.example.demo;/**
 * @author lvyj001
 * @date 2021/6/16
 */

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * @Description TODO
 * @Author lvyj001
 * @Create 2021/6/16 10:18
 */

@RestController
public class DemoController implements InitializingBean {

    private DemoSecondService demoSecondService;

    private DemoThirdService demoThirdService;

    @Value("${lvyj.param1}")
    String value;

    @Autowired
    private DemoFirstService demoFirstService;

//    @Autowired
    public DemoController(DemoSecondService demoSecondService) {
        this.demoSecondService = demoSecondService;
    }

//    @Autowired
    public void setDemoThirdService(DemoThirdService demoThirdService) {
        this.demoThirdService = demoThirdService;
    }

    @GetMapping("getValue")
    public String getValue() {
        return value;
    }

    @Override
    public void afterPropertiesSet() throws Exception {

    }

    @PostConstruct
    public void demoControllerInitMethod(){}

    @PostConstruct
    public void demoControllerInitMethod1(){}
}
